package com.stox.services.indicator.model.intf;

import java.util.List;

import com.stox.shared.indicator.model.IndicatorBeanDescriptor;
import com.stox.shared.model.Bar;

public interface Indicator<OUT, CONFIG> {

	/**
	 * The indicator may or may not support this method, if it needs more information from Bar other than simple double array
	 * 
	 * @param configuration
	 * @param in
	 * @param index
	 * @return
	 * @throws UnsupportedOperationException
	 */
	public OUT getValue(CONFIG configuration, Double[] in, int index) throws UnsupportedOperationException;
	
	public OUT getValue(CONFIG configuration, List<Bar> bars, int index);
	
	/**
	 * The indicator may or may not support this method, if it needs more information from Bar other than simple double array
	 * 
	 * @param configuration
	 * @param in
	 * @return
	 * @throws UnsupportedOperationException
	 */
	public OUT[] getValues(CONFIG configuration, Double[] in) throws UnsupportedOperationException;
	
	public OUT[] getValues(CONFIG configuration, List<Bar> bars);
	
	public CONFIG createDefaultConfiguration();
	
	public IndicatorBeanDescriptor getIndicatorBeanDescriptor();
	
}
